package com.trkj.pojos;

import java.io.Serializable;
import javax.persistence.*;
import java.math.BigDecimal;
import java.util.List;


/**
 * The persistent class for the DRUGSTORAGE_ALLBUYMEDCINE database table.
 * 
 */
@Entity
@Table(name="DRUGSTORAGE_ALLBUYMEDCINE")
@NamedQuery(name="DrugstorageAllbuymedcine.findAll", query="SELECT d FROM DrugstorageAllbuymedcine d")
public class DrugstorageAllbuymedcine implements Serializable {
	private static final long serialVersionUID = 1L;

	public DrugstorageAllbuymedcine(String allbuymedcineName) {
		super();
		this.allbuymedcineName = allbuymedcineName;
	}

	@Id
	@Column(name="DRUGSTORAGE_ALLBUYMEDCINE_ID")
	@SequenceGenerator(initialValue=100,allocationSize=1,name="DRUGSTORAGE_ALLBUYMEDCINE_ID_GENERATOR", sequenceName="SEQID")
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="DRUGSTORAGE_ALLBUYMEDCINE_ID_GENERATOR")
	private long drugstorageAllbuymedcineId;

	@Column(name="ALLBUYMEDCINE_COST")
	private BigDecimal allbuymedcineCost;

	@Column(name="ALLBUYMEDCINE_NAME")
	private String allbuymedcineName;

	@Column(name="EXACT_ALLBUYMEDCINE_COST")
	private BigDecimal exactAllbuymedcineCost;

	//bi-directional many-to-one association to DrugstorageBuymedcineDetail
	@OneToMany(mappedBy="drugstorageAllbuymedcine")
	private List<DrugstorageBuymedcineDetail> drugstorageBuymedcineDetails;

	public DrugstorageAllbuymedcine() {
	}

	public long getDrugstorageAllbuymedcineId() {
		return this.drugstorageAllbuymedcineId;
	}

	public void setDrugstorageAllbuymedcineId(long drugstorageAllbuymedcineId) {
		this.drugstorageAllbuymedcineId = drugstorageAllbuymedcineId;
	}

	public BigDecimal getAllbuymedcineCost() {
		return this.allbuymedcineCost;
	}

	public void setAllbuymedcineCost(BigDecimal allbuymedcineCost) {
		this.allbuymedcineCost = allbuymedcineCost;
	}

	public String getAllbuymedcineName() {
		return this.allbuymedcineName;
	}

	public void setAllbuymedcineName(String allbuymedcineName) {
		this.allbuymedcineName = allbuymedcineName;
	}

	public BigDecimal getExactAllbuymedcineCost() {
		return this.exactAllbuymedcineCost;
	}

	public void setExactAllbuymedcineCost(BigDecimal exactAllbuymedcineCost) {
		this.exactAllbuymedcineCost = exactAllbuymedcineCost;
	}

	public List<DrugstorageBuymedcineDetail> getDrugstorageBuymedcineDetails() {
		return this.drugstorageBuymedcineDetails;
	}

	public void setDrugstorageBuymedcineDetails(List<DrugstorageBuymedcineDetail> drugstorageBuymedcineDetails) {
		this.drugstorageBuymedcineDetails = drugstorageBuymedcineDetails;
	}

	public DrugstorageBuymedcineDetail addDrugstorageBuymedcineDetail(DrugstorageBuymedcineDetail drugstorageBuymedcineDetail) {
		getDrugstorageBuymedcineDetails().add(drugstorageBuymedcineDetail);
		drugstorageBuymedcineDetail.setDrugstorageAllbuymedcine(this);

		return drugstorageBuymedcineDetail;
	}

	public DrugstorageBuymedcineDetail removeDrugstorageBuymedcineDetail(DrugstorageBuymedcineDetail drugstorageBuymedcineDetail) {
		getDrugstorageBuymedcineDetails().remove(drugstorageBuymedcineDetail);
		drugstorageBuymedcineDetail.setDrugstorageAllbuymedcine(null);

		return drugstorageBuymedcineDetail;
	}

}